package com.gec.web.servlet;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.gec.entity.Buycar;
import com.gec.entity.Member;
import com.gec.service.BuycarService;
import com.gec.service.impl.BuycarServiceImpl;
@WebServlet("/delcarfood")
public class DelCarFoodServlet extends HttpServlet {

	@Override
	protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		Member me = (Member) req.getSession().getAttribute("member");
		int bcid = Integer.parseInt(req.getParameter("bid"));
		int sid = Integer.parseInt(req.getParameter("shopid"));
		BuycarService service = new BuycarServiceImpl();
		Buycar bc = new Buycar();
		service.remaove(bcid);
		
		float sum = service.getMoneySum(me.getId());
//		float curPrice = service.findCur(me.getId(),);
//		float 
		float zjsum = service.getZjMoneySum(me.getId());
		List<Buycar> list = new ArrayList<>();
//		list.add(sum);
//		list.add(curPrice);
		
		resp.setContentType("application/json;charset=utf-8");
		PrintWriter out = resp.getWriter();
		out.print(list);
		out.close();
	}
	
}
